\hypertarget{class_zebulon_1_1_m_c_u_1_1_message}{
\section{Zebulon::MCU::Message Class Reference}
\label{class_zebulon_1_1_m_c_u_1_1_message}\index{Zebulon::MCU::Message@{Zebulon::MCU::Message}}
}


\hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} class for creating messages structures for serialization and de-\/serialization of data sent to/from a Microcontroller.  


{\ttfamily \#include $<$message.h$>$}Inheritance diagram for Zebulon::MCU::Message::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=11.9344cm]{class_zebulon_1_1_m_c_u_1_1_message}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a2f23f19457ca7e2a24a9035aeb0e03cd}{
typedef std::vector$<$ \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} $\ast$ $>$ \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a2f23f19457ca7e2a24a9035aeb0e03cd}{List}}
\label{class_zebulon_1_1_m_c_u_1_1_message_a2f23f19457ca7e2a24a9035aeb0e03cd}

\begin{DoxyCompactList}\small\item\em Type definition for a Vector of \hyperlink{namespace_messages}{Messages}. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{
typedef unsigned char \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code}}
\label{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}

\begin{DoxyCompactList}\small\item\em Type definition for message command code. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a19b726c14a5245b0dcad467a2fb30b9a}{
{\bfseries Message} (const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Message::Code} messageCode)}
\label{class_zebulon_1_1_m_c_u_1_1_message_a19b726c14a5245b0dcad467a2fb30b9a}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a1053ce7ea2180e0a9a246623ad4cf71a}{
virtual int {\bfseries Write} (CxUtils::Packet \&packet) const }
\label{class_zebulon_1_1_m_c_u_1_1_message_a1053ce7ea2180e0a9a246623ad4cf71a}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a3ce83c9b08c25534ed4126e5c3eaa657}{
virtual int {\bfseries WriteMessageBody} (CxUtils::Packet \&packet) const }
\label{class_zebulon_1_1_m_c_u_1_1_message_a3ce83c9b08c25534ed4126e5c3eaa657}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a3120d4798c3c8c4449b8576f7d9ed145}{
virtual int {\bfseries Read} (const CxUtils::Packet \&packet)}
\label{class_zebulon_1_1_m_c_u_1_1_message_a3120d4798c3c8c4449b8576f7d9ed145}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_ab2ea298a959b027b3f6e269c608b848a}{
virtual int {\bfseries ReadMessageBody} (const CxUtils::Packet \&packet)}
\label{class_zebulon_1_1_m_c_u_1_1_message_ab2ea298a959b027b3f6e269c608b848a}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a0f713d98e5016e1d6e69c96ac8fa36c7}{
virtual void {\bfseries Print} () const }
\label{class_zebulon_1_1_m_c_u_1_1_message_a0f713d98e5016e1d6e69c96ac8fa36c7}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a58a63939658523fde282346f9d9b6b1b}{
virtual \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} $\ast$ {\bfseries Clone} () const =0}
\label{class_zebulon_1_1_m_c_u_1_1_message_a58a63939658523fde282346f9d9b6b1b}

\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_af15fac8a0179770c6c59572147744186}{
static unsigned char {\bfseries CalculateChecksum} (const CxUtils::Packet \&packet)}
\label{class_zebulon_1_1_m_c_u_1_1_message_af15fac8a0179770c6c59572147744186}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_aa087612dbc74c3abe2fae472d662b2ad}{
static bool {\bfseries IsValid} (const CxUtils::Packet \&packet)}
\label{class_zebulon_1_1_m_c_u_1_1_message_aa087612dbc74c3abe2fae472d662b2ad}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a2842696f8bb82accf011255e1cdb6e99}{
static unsigned int {\bfseries ExtractMessage} (const unsigned char $\ast$buffer, const unsigned int length, \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Message::Code} \&type, CxUtils::Packet \&message)}
\label{class_zebulon_1_1_m_c_u_1_1_message_a2842696f8bb82accf011255e1cdb6e99}

\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a4bb85a6326c3df91d34cfc4d7271ad38}{
\hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Message::Code} \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a4bb85a6326c3df91d34cfc4d7271ad38}{mMessageCode}}
\label{class_zebulon_1_1_m_c_u_1_1_message_a4bb85a6326c3df91d34cfc4d7271ad38}

\begin{DoxyCompactList}\small\item\em \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} code (type of message). \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_aacc347caab66f726b3d5f06cb7af45bf}{
static const unsigned char \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_aacc347caab66f726b3d5f06cb7af45bf}{Header1} = '\#'}
\label{class_zebulon_1_1_m_c_u_1_1_message_aacc347caab66f726b3d5f06cb7af45bf}

\begin{DoxyCompactList}\small\item\em First Header byte for all \hyperlink{namespace_messages}{Messages}. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a000252a5cde635da5103ca19a2caa513}{
static const unsigned char \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a000252a5cde635da5103ca19a2caa513}{Header2} = '\%'}
\label{class_zebulon_1_1_m_c_u_1_1_message_a000252a5cde635da5103ca19a2caa513}

\begin{DoxyCompactList}\small\item\em Second Header byte for all \hyperlink{namespace_messages}{Messages}. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a58a0e5499a0e40c9d3b7306e0398a271}{
static const unsigned int \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a58a0e5499a0e40c9d3b7306e0398a271}{StartOfCommandType} = 2}
\label{class_zebulon_1_1_m_c_u_1_1_message_a58a0e5499a0e40c9d3b7306e0398a271}

\begin{DoxyCompactList}\small\item\em Starting index of command type. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_ac7f46b3f0e1b56edc1f3605ec2e1d36b}{
static const unsigned int \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_ac7f46b3f0e1b56edc1f3605ec2e1d36b}{StartOfData} = 3}
\label{class_zebulon_1_1_m_c_u_1_1_message_ac7f46b3f0e1b56edc1f3605ec2e1d36b}

\begin{DoxyCompactList}\small\item\em Starting index of data in byte array. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a7aebc0ef8c538d7fab6399e6047cb1ec}{
static const unsigned int \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a7aebc0ef8c538d7fab6399e6047cb1ec}{Size} = 8}
\label{class_zebulon_1_1_m_c_u_1_1_message_a7aebc0ef8c538d7fab6399e6047cb1ec}

\begin{DoxyCompactList}\small\item\em Size of all messages in bytes. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_ae118d5691c2eaaf73ea521e48251a546}{
static const unsigned int \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_ae118d5691c2eaaf73ea521e48251a546}{DataSize} = 4}
\label{class_zebulon_1_1_m_c_u_1_1_message_ae118d5691c2eaaf73ea521e48251a546}

\begin{DoxyCompactList}\small\item\em Size of all data in bytes. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_ad66e987376aefdcd544a7911274d351d}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} {\bfseries All} = 0xFF}
\label{class_zebulon_1_1_m_c_u_1_1_message_ad66e987376aefdcd544a7911274d351d}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_aa9d285ebdf438de5986dd98618377ba6}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_aa9d285ebdf438de5986dd98618377ba6}{QueryReport} = 0x00}
\label{class_zebulon_1_1_m_c_u_1_1_message_aa9d285ebdf438de5986dd98618377ba6}

\begin{DoxyCompactList}\small\item\em \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} code for a Query Report. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a09e0180613de308c343cb83cd61a99ba}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a09e0180613de308c343cb83cd61a99ba}{Ping} = 0x0D}
\label{class_zebulon_1_1_m_c_u_1_1_message_a09e0180613de308c343cb83cd61a99ba}

\begin{DoxyCompactList}\small\item\em \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} code for a \hyperlink{class_zebulon_1_1_m_c_u_1_1_ping}{Ping} \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message}. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a1b14d0277ca9910d193f7651a917c9d0}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a1b14d0277ca9910d193f7651a917c9d0}{Pong} = 0x84}
\label{class_zebulon_1_1_m_c_u_1_1_message_a1b14d0277ca9910d193f7651a917c9d0}

\begin{DoxyCompactList}\small\item\em \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message} code for a \hyperlink{class_zebulon_1_1_m_c_u_1_1_pong}{Pong} \hyperlink{class_zebulon_1_1_m_c_u_1_1_message}{Message}. \item\end{DoxyCompactList}\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_afa445c886333922d787c83b6015629a6}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} {\bfseries SetDigitalOutputs} = 0x0C}
\label{class_zebulon_1_1_m_c_u_1_1_message_afa445c886333922d787c83b6015629a6}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a7f5f1066faa796b330f0ba481227299d}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} {\bfseries ReportDigitalInputs} = 0x82}
\label{class_zebulon_1_1_m_c_u_1_1_message_a7f5f1066faa796b330f0ba481227299d}

\item 
\hypertarget{class_zebulon_1_1_m_c_u_1_1_message_a6544e3f57be484febdaa770135fb58cd}{
static const \hyperlink{class_zebulon_1_1_m_c_u_1_1_message_a31e1f57be3ba6baa7fd656b776caea8f}{Code} {\bfseries ReportAnalogInputs} = 0x83}
\label{class_zebulon_1_1_m_c_u_1_1_message_a6544e3f57be484febdaa770135fb58cd}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{class_zebulon_1_1_m_c_u_1_1_interface}{Interface} class for creating messages structures for serialization and de-\/serialization of data sent to/from a Microcontroller. MCU messages are designed to be very simple to make it easy to add support for them on any type of Microcontroller. Therefore messages are of a fixed size and have a unique header (two bytes) and a simple checksum at the end. 

The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/mcu/include/mcu/message.h\end{DoxyCompactItemize}
